home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / array.lha / array / README < prev   
Text File  |  1993-08-08  |  2KB  |  50 lines

  1. verview.
  2.  
  3. his is a C++ class for simple fixed arrays with arbitrary integer
  4. ower and upper bounds and index range checking.  Simple design and
  5. mplementation was a major development goal.  The array class uses
  6. ssertions to check various error conditions, including index
  7. ut-of-range and failed memory allocation.  Failed assertions cause
  8. rogram termination, and possibly a core dump.
  9.  
  10. he element type must have a default constructor (a constructor that
  11. akes no arguments) or be of a type that does not need a constructor,
  12. uch as, integers and other built-in types.  It must also be possible
  13. o assign to the element type, and to destroy elements.
  14.  
  15.  would be grateful for any comments and/or suggestions.  Please
  16. -mail to dag@control.lth.se.
  17.  
  18. ompilation.
  19.  
  20. his is a template class, so it requires a compiler which can handle
  21. uch beasts, for example, AT&T version 3.0.  Minor changes may be
  22. eeded to compile it with g++ (not tested).
  23.  
  24. aveats.
  25.  
  26. he copy-constructor of the array should use the copy-constructor of the
  27. lement type to initialize its elements.  Unfortunately, the obvious
  28. olution does not seem to compile with cfront 3.0.1, so I have chosen
  29. o explicitly outlaw copy-construction of arrays, rather than
  30. roviding a copy-constructor with the wrong semantics.  More
  31. nformation is available in a separate file, COPYNOTE.
  32.  
  33. he current version is moderately robust.  It will for example break
  34. own if you allocate arrays where the number of elements is >MAXINT,
  35. r if the total allocated space overflows a size_t.
  36.  
  37. t is also worth pointing out that Array<T>::size() returns the number
  38. f elements, not the total size of the storage occupied by the array.
  39.  
  40. uthor.
  41.  
  42. ag Bruck, Department of Automatic Control, Lund Institute of
  43. echnology, Box 188, S-221 00 Lund, Sweden. E-mail: dag@control.lth.se
  44.  
  45. cknowledgements.
  46.  
  47.  would like to thank Tom Cargill and John Skaller for comments on the
  48. riginal version.  The current version, and even more so, the next
  49. ersion, benefits from feedback from actual and potential users..
  50.